﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第八十八题
//BC90 矩阵计算
//https://www.nowcoder.com/practice/0c83231923c541d2aa15861571831ee5?tpId=107&tqId=33371&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D107&difficulty=undefined&judgeStatus=undefined&tags=&title=

#include <stdio.h>

int main() {
    int row = 0;
    int col = 0;
    int arr[100][100] = { 0 };
    scanf("%d %d", &row, &col);
    //输入矩阵
    for (int i = 0; i < row; i++) {
        for (int j = 0; j < col; j++) {
            scanf("%d", &arr[i][j]);
        }
    }
    int sum = 0;
    //计算矩阵大于零的元素之和
    for (int i = 0; i < row; i++) {
        for (int j = 0; j < col; j++) {
            if (arr[i][j] > 0)
                sum += arr[i][j];
        }
    }

    printf("%d\n", sum);

    return 0;
}